package CPU;

import java.lang.management.ManagementFactory;

import com.sun.management.OperatingSystemMXBean;
public class CPUTest {
    private static OperatingSystemMXBean osmxb = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();

    public static int cpuLoad() {

        double cpuLoad = osmxb.getSystemCpuLoad();

        int percentCpuLoad = (int) (cpuLoad * 100);

        return percentCpuLoad;

    }
}
class Test{
    public static void main(String[] args) {
        System.out.println();
    }
}

